// const baseurl='http://jsonplaceholder.typicode.com';
const baseurl='/api';
// const baseurl='http://192.168.1.192:8080'
// const baseurl='http://localhost:3000'
export const myRequest = (options)=>{
	console.log(options);
	return new Promise((resolve,reject)=>{
		uni.request({
			url:baseurl+options.url,
			method:options.method||'GET',
			data:options.data||{},
			header: options.header||{
				'Content-Type': 'application/x-www-form-urlencoded'
			},
			success:(res)=>{
				resolve(res.data)
			},
			fail:(err)=>{
				uni.showToast({
					title:'请求接口失败'
				})
				reject(err)
			}
		})
	})
}